<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ include file="/page/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@ include file="/adapter/adapter-bootstrap.jsp"%>
<link
	href="${pageContext.request.contextPath}/frontframe/easyui/themes/easyui-extend.css"
	rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function goBack() {
		window.history.back(-1);
	}
	
	
	//用一个隐藏的input和select联动来实现选择使用挡板
	 function changetype(aThis){
			document.getElementById("wx_resp_type").value=aThis.value;
	}
	 //页面加载时给select预选值
	window.onload=function(){
		var menu_type="${appwxRespAction.wx_resp_type}";
		document.getElementById("wx_resp_type").value=menu_type;
		var all_options = document.getElementById("type_select").options;
		for (var i=0; i<all_options.length; i++){
			if (all_options[i].value == menu_type){
				all_options[i].selected = true;
			}
		}
		
		//给textarea赋值，将换行符转回来
		var text_area="${appwxRespAction.wx_resp_text}".replace(/<br>/g,"\n");
		$("#wx_resp_text").val(text_area);
		
	}
	
</script>
</head>
<body>
	<div class="panel panel-default">
		<div class="panel-heading">
			<h3 class="panel-title">微信动作响应</h3>
		</div>
		<div class="panel-body">
			<form class="form-horizontal" role="form" id="form1">
				<div class="form-group">
					<label class="col-xs-2 control-label" for="wx_resp_actionid">动作编号</label>
					<div class="col-xs-4">
						<input class="form-control" id="wx_resp_actionid"
							name="wx_resp_actionid" type="text" placeholder=""
							readonly="readonly" value="${appwxRespAction.wx_resp_actionid}" />
					</div>
					<label class="col-xs-2 control-label" for="app_id">应用ID</label>
					<div class="col-xs-4">
						<input class="form-control" id="app_id" name="app_id" type="text"
							placeholder="" readonly="readonly"
							value="${appwxRespAction.app_id}" />
					</div>
					
				<!-- 	<label class="col-xs-2 control-label" for="wx_resp_type">动作类型</label>
					<div class="col-xs-4">
						<input class="form-control" id="wx_resp_type" name="wx_resp_type"
							type="text" placeholder="" readonly="readonly"
							value="${appwxRespAction.wx_resp_type}" />
					</div>
				-->

				</div>
				<div class="form-group">
					<label class="col-xs-2 control-label" for="wx_resp_type">动作类型</label>
                          <div class="col-xs-4">
                             <input class="form-control" id="wx_resp_type" name="wx_resp_type" type="hidden" />
                             <select id="type_select"  onchange="changetype(this)" class="form-control"disabled="disabled">
                             	<option value='0' >纯文本</option>
                             	<option value='1'>图文</option>
                             </select>
                          </div> 
					

				</div>
					
				<div class="form-group">
					<label class="col-xs-2 control-label" for="wx_resp_text">响应文本</label>
					<div class="col-xs-10">
						<textarea rows="8" class="form-control" id="wx_resp_text" name="wx_resp_text" readonly="readonly" placeholder="纯文本类型必输，返回的文本内容,回车换行"  /></textarea>
					</div>
				</div>
					
				
				<div class="form-group  text-center">
					<button type="button" class="btn btn-default" onclick="goBack()">返回</button>
				</div>
			</form>
		</div>
	</div>

</body>
</html>
